home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / headers / usertermination.h < prev    next >
Encoding:
Text File  |  2000-06-23  |  2.7 KB  |  100 lines

  1. /*
  2.     File:        UserTermination.h
  3.  
  4.     Contains:    TUserTermination is a command dot tracking class, used for finding out if the end user wants to stop
  5.                   an action. Most of the code is based on earlier snippet by Dave Radcliffe/DTS.
  6.                   TUserTermination.h contains the header file information for the TUserTermination class.
  7.  
  8.     Written by: Kent Sandvik    
  9.  
  10.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  11.  
  12.                 You may incorporate this Apple sample source code into your program(s) without
  13.                 restriction. This Apple sample source code has been provided "AS IS" and the
  14.                 responsibility for its operation is yours. You are not permitted to redistribute
  15.                 this Apple sample source code as "Apple sample source code" after having made
  16.                 changes. If you're going to re-distribute the source, we require that you make
  17.                 it clear in the source that the code was descended from Apple sample source
  18.                 code, but that you've made changes.
  19.  
  20.     Change History (most recent first):
  21.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  22.                 
  23.  
  24. */
  25. // Declare label for this header file
  26. #ifndef _USERTERMINATION_
  27. #define _USERTERMINATION_
  28.  
  29. #ifndef _DTSCPLUSLIBRARY_
  30. #include "DTSCPlusLibrary.h"
  31. #endif
  32.  
  33. #ifndef __SCRIPT__
  34. #include <Script.h>
  35. #endif
  36.  
  37. #ifndef __EVENTS__
  38. #include <Events.h>
  39. #endif
  40.  
  41. #ifndef __RESOURCES__
  42. #include <Resources.h>
  43. #endif
  44.  
  45. #ifndef __OSEVENTS__
  46. #include <OSEvents.h>
  47. #endif
  48.  
  49. #ifndef __GESTALTEQU__
  50. #include <GestaltEqu.h>
  51. #endif
  52.  
  53.  
  54.  
  55.  
  56.  
  57. // _________________________________________________________________________________________________________ //
  58. //    Class Interface
  59.  
  60. class TUserTermination
  61. // TUserTermination is a simple event checking class, that tries to find out when the end user
  62. // has pressed a '.' and a command key, or another combination reminding of a termination
  63. // (such as command-q, even if command-. is the official Apple User Interface way of doing things.
  64. {
  65. public:
  66.     //    ENUMS AND TYPEDEFS
  67.     enum EConstant
  68.     {
  69.         kAUXFindEvent = 8, ktAscii2Mask = 0x000000FF, ktAscii1Mask = 0x00FF0000
  70.     };
  71.  
  72.     //    CONSTRUCTORS AND DESTRUCTORS
  73.     TUserTermination(char ASCIIValue = '.');    // Note dot ('.') as the default ascii char
  74.     virtual~ TUserTermination();
  75.  
  76.     //    INITIALIZATION ROUTINES    
  77.     virtual void Initialize();
  78.  
  79.     //    MAIN INTERFACE
  80.     virtual Boolean Abort();                    // main function
  81.  
  82. protected:
  83.     char fChar;                                    // our initial key value
  84.     char fKeyCode;                                // the key value translated to a virtual code char
  85.     Boolean fAUX;                                // do we run under A/UX or not (different event handling)
  86. };
  87.  
  88. #endif
  89.  
  90. // _________________________________________________________________________________________________________ //
  91.  
  92.  
  93. /*    Change History (most recent last):
  94.   No        Init.    Date        Comment
  95.   1            khs        9/26/92        New file
  96. */
  97.  
  98.  
  99.  
  100.